# -*- coding:utf-8 -*-

from django.conf.urls import url
from views import PeopleRegisterView, LoginView, LogoutView, CompanyListCreateView, CompanyListView, \
    PersonDetailView, CompanyDetailView, PersonListCreateView, AddressListView, PeopleDetailView, UploadFileView, \
    InfoCountListView, CompanyPersonListCreteView, CompanyPersonDetailView, RecordListView, RecordRetrieveView, \
    PersonBindListView, CompanyAutoSubmitView, GetPicCodeView, QueryAllPermissions, AdminRoleListCreateView, \
    AdminRoleDetailView, AuthUserListCreateView, AuthUserDetailView, \
    OrganizationListCreateView, OrganizationDetailView, ElevatorForOrgView, \
    OrganizationElevatorRelationView, ElevatorForRoleView, ElevatorForSupervisionView, OrgForAuthUserListView, \
    ElevatorForAuthUserListView, CompanyForAuthUserView, LoginViewForLazyGirl, AuthUserParamView, WorkHourPriceView, \
    LogRefreshView, SystemLogView
from view_app import AppLoginView, AppLogoutView, AppPersonDetailView, AppPropertyDetailView, APPRegistryQueryView, \
    AppVersionControlView, AppPersonPositionView
from data_export import DataExportView


urlpatterns = [
    url(r"^register/$", PeopleRegisterView.as_view(), name="user-register"),
    url(r"^auth/(?P<pk>\d+)/$", PeopleDetailView.as_view(), name="update_retrieve_delete"),
    url(r"^login/$", LoginView.as_view(), name="user-login"),
    url(r"^logout/$", LogoutView.as_view(), name="user-logout"),
    url(r"^count/$", InfoCountListView.as_view(), name="info_count"),
    url(r"^person/(?P<pk>\d+)/$", PersonDetailView.as_view(), name="person-update-retrieve-delete"),
    url(r"^person/$", PersonListCreateView.as_view(), name="person_create_list"),
    url(r"^person/bind/$", PersonBindListView.as_view(), name="person_bind_list"),
    url(r"^company/$", CompanyListCreateView.as_view(), name="com_create_list"),
    url(r"^company/all/$", CompanyListView.as_view(), name="com_all_list"),
    url(r"^company/(?P<pk>\d+)/$", CompanyDetailView.as_view(), name="com_create_list"),
    # url(r"^website/$", CompanyWebsiteInfoView.as_view(), name="company_web_site_create"),
    # url(r"^website/(?P<pk>\d+)/$", CompanyWebsiteInfoDetailView.as_view(), name="web_site_update_delete_get"),
    url(r"^address/$", AddressListView.as_view(), name="address_list"),
    url(r"^upload/$", UploadFileView.as_view(), name="file_import"),
    url(r"^download/$", DataExportView.as_view(), name="file_export"),
    url(r"^app/login/$", AppLoginView.as_view(), name="app_login"),
    url(r"^app/logout/$", AppLogoutView.as_view(), name="app_logout"),
    url(r"^app/query/$", APPRegistryQueryView.as_view(), name="query"),
    url(r"^app/person/(?P<pk>\d+)/$", AppPersonDetailView.as_view(), name="app_update_get"),
    url(r"^app/property/(?P<pk>\d+)/$", AppPropertyDetailView.as_view(), name="app_update_get"),
    url(r"^app/position/$", AppPersonPositionView.as_view(), name="position-create"),
    url(r"^bind/$", CompanyPersonListCreteView.as_view(), name="company_person_bind"),
    url(r"^bind/(?P<pk>\d+)/$", CompanyPersonDetailView.as_view(), name="company_person"),
    url(r"^logs/$", RecordListView.as_view(), name="logs"),
    url(r"^logs/(?P<pk>\d+)/$", RecordRetrieveView.as_view(), name="log"),
    url(r"^app/version/$", AppVersionControlView.as_view(), name="version"),
    url(r"^submit/$", CompanyAutoSubmitView.as_view(), name="submit-update"),
    url(r"^picture/$", GetPicCodeView.as_view(), name="get-picture"),
    url(r"^permissions/$", QueryAllPermissions.as_view(), name="query_all_permissions"),
    url(r"^role/$", AdminRoleListCreateView.as_view(), name="role-create-list"),
    url(r"^role/elevator/$", ElevatorForRoleView.as_view(), name="list"),
    url(r"^role/(?P<pk>\d+)/$", AdminRoleDetailView.as_view(), name="role-detail"),
    url(r"^role/organization/$", OrgForAuthUserListView.as_view(), name="list"),
    url(r"^user/$", AuthUserListCreateView.as_view(), name="list"),
    url(r"^user/param/$", AuthUserParamView.as_view(), name='list'),
    url(r"^user/(?P<pk>\d+)/$", AuthUserDetailView.as_view(), name="list"),
    url(r"^user/elevator/$", ElevatorForAuthUserListView.as_view(), name="list"),
    url(r"^user/company/$", CompanyForAuthUserView.as_view(), name="list"),
    url(r"^user/bind/$", CompanyPersonListCreteView.as_view(), name="company_person_bind"),
    url(r"^organization/organize/$", OrganizationListCreateView.as_view(), name="list"),
    url(r"^organization/organize/(?P<pk>\d+)/$", OrganizationDetailView.as_view(), name="list"),
    url(r"^organization/code/$", ElevatorForOrgView.as_view(), name="list"),
    url(r"^organization/mycode/$", OrganizationElevatorRelationView.as_view(), name="list"),
    url(r"^supervise/$", ElevatorForRoleView.as_view(), name="list"),
    url(r"^supervise/modify/$", ElevatorForSupervisionView.as_view(), name="post-delete"),
    url(r"^supervise/company/$", CompanyForAuthUserView.as_view(), name="list"),
    url(r"^redirect/$", LoginViewForLazyGirl.as_view(), name="list"),
    url(r"^hour/price/$", WorkHourPriceView.as_view(), name="get-post"),
    url("^refresh/$", LogRefreshView.as_view(), name="get-post"),
    url("^logsV2/$", SystemLogView.as_view(), name="list"),
]
